// 0.导包
import VueRouter from "vue-router";
import Vue from "vue";

import GameMall from "@/views/GameMallView"

//1..Vue模块全局加载(使用)VueRouter模块
Vue.use(VueRouter)
//2.创建路由表

const routes=[
    // {path:'/reg',name:'reg',component:()=>import('../views/RegView.vue')},
    {path:'/reg',name:'reg',component:()=>import('../views/UserReg.vue')},
    {path:'/',name:'login',component:()=>import('../views/UserLogin.vue')},
    {path:'/main',name:'main',component:()=>import('../views/MainView'),children:[
        {path:'/mall',name:'mall',component:GameMall},
        {path:'/hall',name:'hall',component:()=>import('../views/GameHallView.vue')},
        {path:'/',name:'gamehall',component:()=>import('../views/GameNewHallView.vue'),children:[
            
        ]},
        {path:'/child',name:'child',component:()=>import('../views/child/GameHallChildView')},
        {path:'/room',name:'room',component:()=>import('../views/GameRoomView')},
       
    ]},
]

//3.创建路由对象：加载路由表
const router = new VueRouter({
    mode:"hash",  //设置路由地址的样式：默认就是hash
    // routers:routers
    routes   // 当属性和变量名一样，可以简写
})
//4.输出
export default router